home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / scsh / hpux / fdflags.scm < prev    next >
Text File  |  1995-10-13  |  1KB  |  44 lines

  1. ;;; Flags for open(2) and fcntl(2).
  2. ;;; Copyright (c) 1993 by Olin Shivers.
  3.  
  4. (define-syntax define-open-flags
  5.   (syntax-rules ()
  6.     ((define-opens form ...)
  7.      (begin (define-enum-constant "open" . form) ...))))
  8.  
  9. (define-open-flags
  10.   ;; POSIX
  11.   (read            0)
  12.   (write        1)
  13.   (read+write        2)
  14.   (nonblocking        #o200000)
  15.   (append        #o10)
  16.   (no-control-tty    #o400000)
  17.   (create        #o0400)
  18.   (truncate        #o1000)
  19.   (exclusive        #o2000)
  20.  
  21.   ;; NextStep
  22.   (sync        #o100000))    ; Synchronous writes
  23.  
  24. (define open/access-mask
  25.   (bitwise-ior open/read
  26.            (bitwise-ior open/write open/read+write)))
  27.  
  28. ;;; These are internal; they are not part of the supported scsh interface.
  29.  
  30. (define fcntl/close-on-exec         1)
  31.  
  32. (define fcntl/dupfd            0)
  33. (define fcntl/get-fd-flags        1)
  34. (define fcntl/set-fd-flags        2)
  35. (define fcntl/get-file-flags        3)
  36. (define fcntl/set-file-flags        4)
  37. (define fcntl/get-record-lock        5)    ; F_GETLK
  38. (define fcntl/set-record-lock-noblock    6)    ; F_SETLK
  39. (define fcntl/set-record-lock        7)    ; F_SETLKW
  40.  
  41. (define lock/read    1)    ; F_RDLCK
  42. (define lock/write    2)    ; F_WRLCK
  43. (define lock/release    3)    ' F_UNLCK
  44.